<template>
    <div class="usercenter">
        <div class="header">
            <div class="header_title">
                <div class="title_avatar">
                    <img :src="LoginUser.avatar_text" alt="">
                </div>
                <div class="title_content">
                    <div class="content_text">{{LoginUser.nickname}}</div>
                    <div class="content_sm">{{UserCreatetime}}</div>
                </div>
            </div>
            <div class="operate">
                <div class="text-sm">
                    <span class="text-bold">0</span>
                    收藏夹
                </div>
                <div class="text-sm">
                    <span class="text-bold">0</span>
                    余额
                </div>
                <div class="text-sm">
                    <span class="text-bold">0</span>
                    足迹
                </div>
                <div class="text-sm">
                    <span class="text-bold">0</span>
                    全部订单
                </div>
            </div>
        </div>
        <div class="userorder">
            <div class="order_project">
                <div class="item" v-for="item in ordrlist">
                    <router-link :to="{path:'/order/index',query:{status:item.status}}" class="item">
                        <div class="img">
                            <img :src="item.src" alt="">
                        </div>
                        {{ item.name }}
                    </router-link>
                </div>
            </div>
        </div>
        <div class="userorder">
            <div class="order_project">
                <div class="item">
                    <RouterLink to="/business/qrcode" class="item">
                        <div class="img"> <img src="/assets/images/retail1.png" alt=""></div>
                        分销信息
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/membership" class="item">
                        <div class="img"> <img src="/assets/images/retail2.png" alt=""></div>
                        分销会员
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/commission" class="item">
                        <div class="img"> <img src="/assets/images/retail3.png" alt=""></div>
                        分销佣金
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/coupon" class="item">
                        <div class="img"> <img src="/assets/images/coupon.png" alt=""></div>
                        优惠列表
                    </RouterLink>
                </div>
                <div class="item solid-left">
                    <a href="deposit.html" class="item">
                        <div class="img"> <img src="/assets/images/recharge2.png" alt=""></div>
                        充值中心
                    </a>
                </div>
            </div>
        </div>
        <div class="usertool">
            <div class="list">
                <div class="item">
                    <RouterLink to="/business/profile">
                        <div class="img">
                            <img src="/assets/images/profile.png" alt="">
                        </div>
                        基本资料
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/teambuy">
                        <div class="img"> <img src="/assets/images/pingtuan.png" alt=""></div>
                        拼团订单
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/address/index">
                        <div class="img"> <img src="/assets/images/address.png" alt=""></div>
                        收货地址
                    </RouterLink>
                </div>
                <div class="item" v-if="LoginUser.auth == '0'">
                    <RouterLink to="/business/email">
                        <div class="img"> <img src="/assets/images/email.png" alt=""></div>
                        邮箱认证
                    </RouterLink>
                </div>
                <div class="item">
                    <RouterLink to="/business/spendrecord">
                        <div class="img"> <img src="/assets/images/consume.png" alt=""></div>
                        消费记录
                    </RouterLink>
                </div>
                <div class="item">
                    <a href="record.html">
                        <div class="img"> <img src="/assets/images/recharge1.png" alt=""></div>
                        充值记录
                    </a>
                </div>
                <div class="item">
                    <a href="javascript:void(0)" @click="logout">
                        <div class="img"> <img src="/assets/images/returns.png" alt=""></div>
                        退出登陆
                    </a>
                </div>
            </div>
        </div>
        <div class="usertool">
            <ul class="proul">
                
            </ul>
        </div>
        <div class="h54"></div>
        <div class="clear"></div>
    </div>
    <Footer />
</template>
<script setup>
import Footer from '@/components/common/footer.vue'
const { proxy } = getCurrentInstance()

let LoginUser = reactive(proxy.$cookies.get('LoginUser') ? proxy.$cookies.get('LoginUser') : {})
let UserCreatetime = toRef(LoginUser.createtime).value.replace(/\d\d:\d\d:\d\d/, '')

const ordrlist = [
    {
        status: 1,
        name: '待支付',
        src: '/assets/images/order1.png'
    },
    {
        status: 2,
        name: '待发货',
        src: '/assets/images/order2.png'
    },
    {
        status: 3,
        name: '待收货',
        src: '/assets/images/order3.png'
    },
    {
        status: 4,
        name: '待评价',
        src: '/assets/images/order4.png'
    },
    {
        status: -1,
        name: '退货/售后',
        src: '/assets/images/returns.png'
    }
]

const logout = () => {
    showConfirmDialog({
        title: '退出',
        message:
            '确认是否退出登陆?',
    })
    .then(() => {
        proxy.$cookies.remove('LoginUser')
        proxy.$router.push('/business/login')
    })
    .catch(() => {});
}
</script>
<style>
@import url("/assets/css/my.css");
</style>